<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
    function sum(){
       alert(arguments.length);
        alert(arguments[0]);
        //参数不定，求和的方法如下：
        var result=0;
        for(var i=0;i<arguments.length;i++){
            result+=arguments[i];
        }
        return result;

    }
    alert(sum(12,6,8,12,6,8,12,6,8,12,6,8,12,6,8,12,6,8,12,6,8,12,6,8));
    </script>
</head>
<body>

</body>
</html>
<!--arguments 可变参  不定参- 数组->
<!--参数的个数可变，参数数组-->